#include<queue>
#include<iostream>
#include<string>
#include<vector>
using ll=long long int;
using namespace std;


int main()
{
    ll sum=0;
    int n,k;
    cin>>n>>k;
    vector<ll>nums(n,0);
    priority_queue<ll>q;
    for(int i=0;i<n;i++)
    {
        cin>>nums[i];
        sum+=nums[i];
        q.push(nums[i]);
    }
    while(k&&!q.empty())
    {
        int top=q.top();
        if(top%2==0)
        {
            q.pop();
            q.push(top/2);
            sum-=top/2;
            k--;
        }
        else
        {
            q.pop();
        }
    }
    cout<<sum;
    return 0;
}